#pragma once
#include <lcir/ADT/ListNode.h>
#include <dialects/PL/Dialect.h>
#include <lcir/IR/Prototype.h>
#include <lcir/IR/Slots.h>
#include <lcir/IR/Type.h>
// #include "dialects/Builtin/Types.h"

namespace lcir::pl {
class CondBlockTy : public BasicTypeCRTP<CondBlockTy, PlDialect> {
 public:
  CondBlockTy() : BasicTypeCRTP("CondBlock") {}
};

class CondBlockProto : public PrototypeCRTP<CondBlockProto, PlDialect, LambdaRef>, public IListNode<CondBlockProto> {
 public:
  CondBlockProto(Lambda *lambda) : PrototypeCRTP("CondBlock", CondBlockTy::get()) {
    getSlot<LambdaRef>()->setLambda(lambda);
  }
  Lambda *getLambda() { return getSlot<LambdaRef>()->getLambda(); }
  CondBlockProto *getNext() { return IListNode::getNext(); }
  void setNext(CondBlockProto *next) { IListNode::setNext(next); }
  CondBlockProto *getPrev() { return IListNode::getPrev(); }
  void setPrev(CondBlockProto *prev) { IListNode::setPrev(prev); }
};

/**
 * @brief 变量原型
 */
// template <class Derived>
// class PlVarProto : public PrototypeCRTP<PlVarProto<Derived>, PlDialect> {
//   public:
//   PlVarProto(std::string propname, Type *type) : PrototypeCRTP<PlVarProto<Derived>, PlDialect>(propname, type) {}
// };
// class Int32PlVarProto : public PlVarProto<Int32PlVarProto> {
//   std::string varName{};
//   public:
//   Int32PlVarProto(std::string name) : PlVarProto("int32Var", builtin::Int32Type::get()), varName(name) {
//   }
// };
// class FloatPlVarProto : public PlVarProto<FloatPlVarProto > {
//   std::string varName{};
//  public:
//   FloatPlVarProto(std::string name) : PlVarProto("float32Var", builtin::FloatType::get()), varName(name) {}
// };
// class UnkownPlVarProto: public PlVarProto<UnkownPlVarProto> {
//   std::string varName{};
//  public:
//    UnkownPlVarProto(std::string name) : PlVarProto("unkownVar", builtin::UnkownType::get()), varName(name) {}
// };
}  // namespace lcir::pl